document.getElementById('searchButton').addEventListener('click', function() {
    let searchQuery = document.getElementById('searchInput').value;
    let originalKeywords = searchQuery.split(/\s+/); 
    let keywords = originalKeywords.map(keyword => keyword.toLowerCase()); 
    let searchUrl = '';

    if (keywords.length > 0) {
        let lowerCaseQuery = searchQuery.toLowerCase();

        if (keywords.includes('摄影')||keywords.includes('photograpy')) {
            searchUrl = '../兰/摄影.html?query=' + encodeURIComponent(lowerCaseQuery);
        } 
        else if (keywords.includes('ps')) {
            searchUrl = '../瑜-ps/a-ps.html?query=' + encodeURIComponent(lowerCaseQuery);
        } 
        else if (keywords.includes('首页')) {
            searchUrl = '../index首页.html?query=' + encodeURIComponent(lowerCaseQuery);
        } 
        window.location.href = searchUrl;
    } else {
        alert('请输入搜索词');
    }
});